echo "ok deploy command"
${CMD_PREFIX} ostree admin --print-current-dir > curdir
-assert_file_has_content curdir ^`pwd`/sysroot/ostree/deploy/testos/deploy/${rev}.0$
+assert_file_has_content curdir ^`pwd`/sysroot/ostree/deploy/testos/deploy/${rev}\.0$
echo "ok --print-current-dir"
${CMD_PREFIX} ostree admin set-origin --index=0 bacon --set=gpg-verify=false http://tasty.com
assert_file_has_content "${originfile}" "bacon:testos/buildmaster/x86_64-runtime"
${CMD_PREFIX} ostree --repo=sysroot/ostree/repo remote list -u > remotes.txt
-assert_file_has_content remotes.txt 'bacon.*http://tasty.com'
+assert_file_has_content remotes.txt 'bacon.*http://tasty\.com'
cp saved-origin ${originfile}
validate_bootloader
$OSTREE commit ${COMMIT_ARGS} -b branch-with-commitmsg -F commitmsg.txt -s 'a message' $test_tmpdir/checkout-test2-4
$OSTREE log branch-with-commitmsg > log.txt
assert_file_has_content log.txt '^ *This is a long$'
-assert_file_has_content log.txt '^ *Build-Host:.*example.com$'
+assert_file_has_content log.txt '^ *Build-Host:.*example\.com$'
assert_file_has_content log.txt '^ *Crunchy-With.*true$'
$OSTREE refs --delete branch-with-commitmsg
echo "ok commit body file"
csum=$(ostree commit -b testref --link-checkout-speedup --tree=dir=co)
ostree fsck
ostree ls -X testref ${victim_symlink} > ls.txt
-assert_file_has_content ls.txt 'security.biometric'
+assert_file_has_content ls.txt 'security\.biometric'
ostree ls -X ${host_refspec} ${victim_symlink} > ls.txt
-assert_not_file_has_content ls.txt security.biometric
+assert_not_file_has_content ls.txt security\.biometric
ostree ls -X testref usr/bin > ls.txt
-assert_file_has_content ls.txt 'security.crunchy'
+assert_file_has_content ls.txt 'security\.crunchy'
ostree checkout -H testref co-testref
getfattr -n security.biometric co-testref/${victim_symlink} > xattr.txt
-assert_file_has_content xattr.txt 'security.biometric="iris"'
+assert_file_has_content xattr.txt 'security\.biometric="iris"'
getfattr -n security.crunchy co-testref/usr/bin > xattr.txt
-assert_file_has_content xattr.txt 'security.crunchy="withketchup"'
+assert_file_has_content xattr.txt 'security\.crunchy="withketchup"'
rm co -rf
rm co-testref -rf
ostree --repo=repo ls rootfs /usr/bin/systemd >ls.txt
assert_file_has_content ls.txt '^-007.. 0 0 .*/usr/bin/systemd'
ostree --repo=repo ls -X rootfs /usr/lib/dbus-daemon-helper >ls.txt
-assert_file_has_content ls.txt '^-007.. 0 81 .*security.selinux.*/usr/lib/dbus-daemon-helper'
-assert_not_file_has_content ls.txt 'user.ostreemeta'
+assert_file_has_content ls.txt '^-007.. 0 81 .*security\.selinux.*/usr/lib/dbus-daemon-helper'
+assert_not_file_has_content ls.txt 'user\.ostreemeta'
echo "ok bare-user link-checkout-speedup with modified xattrs maintains uids"
date
${CMD_PREFIX} ostree --repo=ostree-srv/repo summary -u
${CMD_PREFIX} ostree --repo=repo pull origin ${remote_ref}@${prev_rev}
${CMD_PREFIX} ostree --repo=repo pull --dry-run --require-static-deltas origin ${remote_ref} >dry-run-pull.txt
-assert_file_has_content dry-run-pull.txt 'Delta update: 0/1 parts, 0 bytes/[45][0-9].[0-9][ ]kB, 1.[678][ ]MB total uncompressed'
+assert_file_has_content dry-run-pull.txt 'Delta update: 0/1 parts, 0 bytes/[45][0-9]\.[0-9][ ]kB, 1\.[678][ ]MB total uncompressed'
${CMD_PREFIX} ostree --repo=repo pull --require-static-deltas origin ${remote_ref}
final_rev=$(${CMD_PREFIX} ostree --repo=repo rev-parse origin:${remote_ref})
assert_streq "${rev}" "${final_rev}"
assert_not_file_has_content out.txt 'No update available'
assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0
assert_not_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0
-assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1.0.9'
+assert_file_has_content sysroot/boot/loader/entries/ostree-1-testos.conf 'TestOS 42 1\.0\.9'
assert_streq "${rev}" $(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
# Now, generate new content upstream; we shouldn't pull it
os_repository_new_commit
${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt
assert_not_file_has_content out.txt 'No update available'
-assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'TestOS 42 1.0.10'
+assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'TestOS 42 1\.0\.10'
assert_has_dir sysroot/ostree/deploy/testos/deploy/${parent_rev}.0
assert_has_dir sysroot/ostree/deploy/testos/deploy/${rev}.0
${CMD_PREFIX} ostree admin upgrade --os=testos --deploy-only --os=testos > out.txt
assert_file_has_content list.txt "1"
assert_file_has_content list.txt "Flathub"
assert_file_has_content list.txt "true"
-assert_file_has_content list.txt "http://example.com/ostree/repo/"
+assert_file_has_content list.txt "http://example\.com/ostree/repo/"
# Check that it errors out if too many arguments are given
if ${CMD_PREFIX} ostree config --repo=repo get --group=core lock-timeout-secs extra 2>err.txt; then
assert_file_has_content repo/config "bare-user-only"
assert_file_has_content repo/config "Nightly Flathub"
assert_file_has_content repo/config "false"
-assert_file_has_content repo/config "http://example.com/ostree/"
+assert_file_has_content repo/config "http://example\.com/ostree/"
# Check that it errors out if too many arguments are given
if ${CMD_PREFIX} ostree config --repo=repo set --group=core lock-timeout-secs 120 extra 2>err.txt; then
assert_has_dir dest-mount1/.ostree/repo
${CMD_PREFIX} ostree --repo=dest-mount1/.ostree/repo refs --collections > dest-refs
-assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$"
-assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$"
-assert_not_file_has_content dest-refs "^(org.example.Collection1, test-3)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$"
+assert_not_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$"
assert_has_file dest-mount1/.ostree/repo/summary
echo "ok 1 simple usb"
assert_has_dir "dest-mount3/some-dest"
assert_symlink_has_content "dest-mount3/.ostree/repos.d/00-generated" "/some-dest$"
${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated refs --collections > dest-refs
-assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$"
assert_has_file dest-mount3/.ostree/repos.d/00-generated/summary
echo "ok 3 usb in non-standard location"
assert_has_dir "dest-mount3/some-dest"
assert_symlink_has_content "dest-mount3/.ostree/repos.d/00-generated" "/some-dest$"
${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated refs --collections > dest-refs
-assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$"
-assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$"
-assert_file_has_content dest-refs "^(org.example.Collection1, test-3)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$"
+assert_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$"
${CMD_PREFIX} ostree --repo=dest-mount3/.ostree/repos.d/00-generated summary -v > dest-summary
-assert_file_has_content dest-summary "(org.example.Collection1, test-1)$"
-assert_file_has_content dest-summary "(org.example.Collection1, test-2)$"
-assert_file_has_content dest-summary "(org.example.Collection1, test-3)$"
+assert_file_has_content dest-summary "(org\.example\.Collection1, test-1)$"
+assert_file_has_content dest-summary "(org\.example\.Collection1, test-2)$"
+assert_file_has_content dest-summary "(org\.example\.Collection1, test-3)$"
echo "ok 4 adding ref to an existing usb"
${CMD_PREFIX} ostree --repo=finder-repo remote add remote1 file://$(pwd)/just-needed-for-the-keyring --collection-id org.example.Collection1 --gpg-import="${test_tmpdir}/gpghome/key1.asc"
${test_builddir}/repo-finder-mount finder-repo dest-mount1 org.example.Collection1 test-1 org.example.Collection1 test-2 &> out
-assert_file_has_content out "^0 .*_2Fdest-mount1_2F.ostree_2Frepo_remote1.trustedkeys.gpg org.example.Collection1 test-1 $(ostree --repo=repo show test-1)$"
-assert_file_has_content out "^0 .*_2Fdest-mount1_2F.ostree_2Frepo_remote1.trustedkeys.gpg org.example.Collection1 test-2 $(ostree --repo=repo show test-2)$"
+assert_file_has_content out "^0 .*_2Fdest-mount1_2F\.ostree_2Frepo_remote1\.trustedkeys\.gpg org\.example\.Collection1 test-1 $(ostree --repo=repo show test-1)$"
+assert_file_has_content out "^0 .*_2Fdest-mount1_2F\.ostree_2Frepo_remote1\.trustedkeys\.gpg org\.example\.Collection1 test-2 $(ostree --repo=repo show test-2)$"
echo "ok 5 find from usb repo"
${CMD_PREFIX} ostree --repo=local refs --collections > refs
cat refs | wc -l > refscount
-assert_file_has_content refs "^(org.example.AppsCollection, app1)$"
-assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$"
+assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$"
+assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$"
assert_file_has_content refscount "^2$"
# Create a local mirror repository where we pull the branches *in mirror mode* from the two remotes.
assert_file_has_content remotescount "^0$"
${CMD_PREFIX} ostree --repo=local-mirror refs --collections > refs
-assert_file_has_content refs "^(org.example.AppsCollection, app1)$"
-assert_file_has_content refs "^(org.example.OsCollection, os/amd64/master)$"
+assert_file_has_content refs "^(org\.example\.AppsCollection, app1)$"
+assert_file_has_content refs "^(org\.example\.OsCollection, os/amd64/master)$"
assert_file_has_content local-mirror/refs/mirrors/org.example.AppsCollection/app1 "^$(cat app1-checksum)$"
assert_file_has_content local-mirror/refs/mirrors/org.example.OsCollection/os/amd64/master "^$(cat os-checksum)$"
# Try finding an update for an existing branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
- assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$"
- assert_file_has_content find "^1/1 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
+ assert_file_has_content find "^1/1 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Find several updates for several existing branches.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
- assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$"
+ assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
- assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum)$"
- assert_file_has_content find "^2/2 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$"
+ assert_file_has_content find "^2/2 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Find some updates and a new branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
- assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$"
- assert_file_has_content find "^ - (org.example.AppsCollection, app2) = $(cat app2-checksum)$"
+ assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, app2) = $(cat app2-checksum)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
- assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum)$"
- assert_file_has_content find "^3/3 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum)$"
+ assert_file_has_content find "^3/3 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Find an update and a non-existent branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.AppsCollection app1 org.example.AppsCollection not-an-app > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/apps-collection$"
- assert_file_has_content find "^ - Keyring: apps-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.AppsCollection, not-an-app) = (not found)$"
- assert_file_has_content find "^ - (org.example.AppsCollection, app1) = $(cat app1-checksum)$"
+ assert_file_has_content find "^ - Keyring: apps-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, not-an-app) = (not found)$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, app1) = $(cat app1-checksum)$"
assert_file_has_content find "^Refs not found in any remote:$"
- assert_file_has_content find "^ - (org.example.AppsCollection, not-an-app)$"
- assert_file_has_content find "^1/2 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - (org\.example\.AppsCollection, not-an-app)$"
+ assert_file_has_content find "^1/2 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Do all the above, but pull this time.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 > pull || true
- assert_file_has_content pull "^1/1 refs were found.$"
- assert_file_has_content pull "^Pulled 1/1 refs successfully.$"
+ assert_file_has_content pull "^1/1 refs were found\.$"
+ assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.OsCollection os/amd64/master > pull
- assert_file_has_content pull "^2/2 refs were found.$"
- assert_file_has_content pull "^Pulled 2/2 refs successfully.$"
+ assert_file_has_content pull "^2/2 refs were found\.$"
+ assert_file_has_content pull "^Pulled 2/2 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum)
assert_ref $repo os/amd64/master $(cat os-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection app2 org.example.OsCollection os/amd64/master > pull
- assert_file_has_content pull "^3/3 refs were found.$"
- assert_file_has_content pull "^Pulled 3/3 refs successfully.$"
+ assert_file_has_content pull "^3/3 refs were found\.$"
+ assert_file_has_content pull "^Pulled 3/3 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum)
assert_ref $repo app2 $(cat app2-checksum)
assert_ref $repo os/amd64/master $(cat os-checksum)
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.AppsCollection app1 org.example.AppsCollection not-an-app > pull
- assert_file_has_content pull "^1/2 refs were found.$"
+ assert_file_has_content pull "^1/2 refs were found\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo app1 $(cat app1-checksum)
assert_not_ref $repo not-an-app
# Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
- assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
- assert_file_has_content find "^1/1 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
+ assert_file_has_content find "^1/1 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true
- assert_file_has_content pull "^1/1 refs were found.$"
- assert_file_has_content pull "^Pulled 1/1 refs successfully.$"
+ assert_file_has_content pull "^1/1 refs were found\.$"
+ assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-2)
# Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
- assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
+ assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/local-mirror$"
- assert_file_has_content find "^ - Keyring: os-remote-local-mirror.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
- assert_file_has_content find "^1/1 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: os-remote-local-mirror\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-2)$"
+ assert_file_has_content find "^1/1 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true
- assert_file_has_content pull "^1/1 refs were found.$"
- assert_file_has_content pull "^Pulled 1/1 refs successfully.$"
+ assert_file_has_content pull "^1/1 refs were found\.$"
+ assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-2)
done
# Try finding an update for that branch.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config org.example.OsCollection os/amd64/master > find
assert_file_has_content find "^Result [0-9]\+: file://$(pwd)/os-collection$"
- assert_file_has_content find "^ - Keyring: os-remote.trustedkeys.gpg$"
- assert_file_has_content find "^ - (org.example.OsCollection, os/amd64/master) = $(cat os-checksum-3)$"
- assert_file_has_content find "^1/1 refs were found.$"
- assert_not_file_has_content find "^No results.$"
+ assert_file_has_content find "^ - Keyring: os-remote\.trustedkeys\.gpg$"
+ assert_file_has_content find "^ - (org\.example\.OsCollection, os/amd64/master) = $(cat os-checksum-3)$"
+ assert_file_has_content find "^1/1 refs were found\.$"
+ assert_not_file_has_content find "^No results\.$"
# Pull it.
${CMD_PREFIX} ostree --repo=$repo find-remotes --finders=config --pull org.example.OsCollection os/amd64/master > pull || true
- assert_file_has_content pull "^1/1 refs were found.$"
- assert_file_has_content pull "^Pulled 1/1 refs successfully.$"
+ assert_file_has_content pull "^1/1 refs were found\.$"
+ assert_file_has_content pull "^Pulled 1/1 refs successfully\.$"
assert_not_file_has_content pull "Failed to pull some refs from the remotes"
assert_ref $repo os/amd64/master $(cat os-checksum-3)
done
# fsck at this point should succeed
${CMD_PREFIX} ostree fsck --repo=repo > fsck
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
# Drop the commit the ref points to, and drop the original ref so that fsck doesn’t prematurely fail on that.
find repo/objects -name '*.commit' -delete -print | wc -l > commitcount
if ${CMD_PREFIX} ostree fsck --repo=repo > fsck; then
assert_not_reached "fsck unexpectedly succeeded after deleting commit!"
fi
-assert_file_has_content fsck "^Validating refs...$"
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 1 fsck-collections"
rm -rf repo/refs/mirrors
${CMD_PREFIX} ostree fsck --repo=repo > fsck
-assert_file_has_content fsck "^Validating refs...$"
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 2 fsck-collections in old repository"
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref1’)"
-assert_file_has_content fsck "^Validating refs...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
echo "ok 3 fsck detects missing ref bindings"
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref1’)"
-assert_file_has_content fsck "^Validating refs...$"
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 4 fsck detects missing collection–ref bindings"
if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck 2> fsck-error; then
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
-assert_file_has_content fsck-error "Commit has collection ID ‘org.example.Collection’ in collection binding metadata, while the remote it came from has collection ID ‘org.example.Collection2’"
-assert_file_has_content fsck "^Validating refs...$"
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck-error "Commit has collection ID ‘org\.example\.Collection’ in collection binding metadata, while the remote it came from has collection ID ‘org\.example\.Collection2’"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 5 fsck detects missing collection–ref bindings"
# fsck at this point should succeed
${CMD_PREFIX} ostree fsck --repo=repo > fsck
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 6 fsck ignores unreferenced ref bindings"
if ${CMD_PREFIX} ostree fsck --repo=repo --verify-back-refs > fsck 2> fsck-error; then
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
-assert_file_has_content fsck-error "Collection–ref (org.example.Collection, ref1) in bindings for commit .* does not exist"
-assert_file_has_content fsck "^Validating refs...$"
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck-error "Collection–ref (org\.example\.Collection, ref1) in bindings for commit .* does not exist"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
echo "ok 7 fsck ignores unreferenced ref bindings"
# fsck at this point should succeed
${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck
-assert_file_has_content fsck "^Validating refs in collections...$"
+assert_file_has_content fsck "^Validating refs in collections\.\.\.$"
# Drop the commit the ref points to, and drop the original ref so that fsck doesn’t prematurely fail on that.
find repo/objects -name '*.commit' -delete -print | wc -l > commitcount
if ${CMD_PREFIX} ostree fsck --repo=repo --verify-bindings > fsck; then
assert_not_reached "fsck unexpectedly succeeded after deleting commit!"
fi
-assert_file_has_content fsck "^Validating refs...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
echo "ok 8 fsck-collections"
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
assert_file_has_content fsck-error "Commit has no requested ref ‘new-ref’ in ref binding metadata (‘ref3’, ‘ref4’)"
-assert_file_has_content fsck "^Validating refs...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
echo "ok 9 fsck detects missing ref bindings"
# fsck at this point should succeed
${CMD_PREFIX} ostree fsck --repo=repo > fsck
-assert_file_has_content fsck "^Validating refs...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
echo "ok 10 fsck ignores unreferenced ref bindings"
assert_not_reached "fsck unexpectedly succeeded after adding unbound ref!"
fi
assert_file_has_content fsck-error "Ref ‘ref3’ in bindings for commit .* does not exist"
-assert_file_has_content fsck "^Validating refs...$"
+assert_file_has_content fsck "^Validating refs\.\.\.$"
echo "ok 11 fsck ignores unreferenced ref bindings"
# Check that initialising a repository with a collection ID results in the ID being in the config.
mkdir repo
ostree_repo_init repo --collection-id org.example.Collection
-assert_file_has_content repo/config "^collection-id=org.example.Collection$"
+assert_file_has_content repo/config "^collection-id=org\.example\.Collection$"
echo "ok init-collections"
${CMD_PREFIX} ostree admin deploy --os=testos testos:testos/buildmaster/x86_64-runtime
assert_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'init='
- assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my .dtb file"
+ assert_file_has_content sysroot/boot/"$(get_key_from_bootloader_conf sysroot/boot/loader/entries/ostree-2-testos.conf 'devicetree')" "my \.dtb file"
assert_not_file_has_content sysroot/boot/loader/entries/ostree-2-testos.conf 'initrd'
echo "ok switching from initramfs to no initramfs sysroot with devicetree layout=$layout"
assert_file_has_content summary.txt "* other"
assert_file_has_content summary.txt "* yet-another"
assert_file_has_content summary.txt "found 1 signature"
-assert_file_has_content summary.txt "Good signature from \"Ostree Tester <test@test.com>\""
+assert_file_has_content summary.txt "Good signature from \"Ostree Tester <test@test\.com>\""
grep static-deltas summary.txt > static-deltas.txt
assert_file_has_content static-deltas.txt \
$(${OSTREE} --repo=repo rev-parse origin:main)
${CMD_PREFIX} ostree --repo=repo refs > refs
assert_file_has_content refs "^test\-1$"
assert_file_has_content refs "^test\-5$"
-assert_not_file_has_content refs "org.example.Collection"
+assert_not_file_has_content refs "org\.example\.Collection"
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
-assert_file_has_content refs "^(org.example.Collection, test-1)$"
-assert_file_has_content refs "^(org.example.Collection, test-5)$"
+assert_file_has_content refs "^(org\.example\.Collection, test-1)$"
+assert_file_has_content refs "^(org\.example\.Collection, test-5)$"
# Similarly, the collection IDs should only be listed when filtering if --collections is passed.
${CMD_PREFIX} ostree --repo=repo refs --list org.example.Collection | wc -l > refscount
assert_not_file_has_content refs "^ctest-mirror$"
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
-assert_file_has_content refs "^(org.example.Collection, ctest)$"
-assert_file_has_content refs "^(org.example.NewCollection, ctest-mirror)$"
+assert_file_has_content refs "^(org\.example\.Collection, ctest)$"
+assert_file_has_content refs "^(org\.example\.NewCollection, ctest-mirror)$"
# Remote refs should be listed if they have collection IDs
${CMD_PREFIX} ostree --repo=repo pull collection-repo-remote rcommit
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
-assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
+assert_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$"
${CMD_PREFIX} ostree --repo=repo refs --collections org.example.RemoteCollection > refs
-assert_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
+assert_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$"
${CMD_PREFIX} ostree --repo=repo refs --collections org.example.NonexistentID > refs
-assert_not_file_has_content refs "^(org.example.RemoteCollection, rcommit)$"
+assert_not_file_has_content refs "^(org\.example\.RemoteCollection, rcommit)$"
cd ${test_tmpdir}
mkdir no-collection-repo
rm -rf repo/refs/mirrors
${CMD_PREFIX} ostree --repo=repo refs --collections --create=org.example.NewCollection:ctest-mirror ctest
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
-assert_file_has_content refs "^(org.example.Collection, ctest)$"
-assert_file_has_content refs "^(org.example.NewCollection, ctest-mirror)$"
+assert_file_has_content refs "^(org\.example\.Collection, ctest)$"
+assert_file_has_content refs "^(org\.example\.NewCollection, ctest-mirror)$"
rm -rf repo/refs/mirrors
${CMD_PREFIX} ostree refs --repo=repo --collections --delete org.example.NonexistentCollection
assert_file_has_content list.txt "origin"
assert_file_has_content list.txt "another"
assert_file_has_content list.txt "another-noexist"
-assert_not_file_has_content list.txt "http://example.com/ostree/gnome"
-assert_not_file_has_content list.txt "http://another.com/repo"
-assert_not_file_has_content list.txt "http://another-noexist.example.com/anotherrepo"
+assert_not_file_has_content list.txt "http://example\.com/ostree/gnome"
+assert_not_file_has_content list.txt "http://another\.com/repo"
+assert_not_file_has_content list.txt "http://another-noexist\.example\.com/anotherrepo"
echo "ok remote list"
$OSTREE remote list --show-urls > list.txt
assert_file_has_content list.txt "origin"
assert_file_has_content list.txt "another"
assert_file_has_content list.txt "another-noexist"
-assert_file_has_content list.txt "http://example.com/ostree/gnome"
-assert_file_has_content list.txt "http://another.com/repo"
-assert_file_has_content list.txt "http://another-noexist.example.com/anotherrepo"
+assert_file_has_content list.txt "http://example\.com/ostree/gnome"
+assert_file_has_content list.txt "http://another\.com/repo"
+assert_file_has_content list.txt "http://another-noexist\.example\.com/anotherrepo"
echo "ok remote list with urls"
cd ${test_tmpdir}
# Overwrite with --force
$OSTREE remote add --force another http://another.example.com/anotherrepo
$OSTREE remote list --show-urls > list.txt
-assert_file_has_content list.txt "^another \+http://another.example.com/anotherrepo$"
+assert_file_has_content list.txt "^another \+http://another\.example\.com/anotherrepo$"
echo "ok remote add --force"
assert_has_dir "${usb_mount}"/.ostree/repo
${CMD_PREFIX} ostree --repo="${usb_mount}"/.ostree/repo refs --collections > dest-refs
- assert_file_has_content dest-refs "^(org.example.Collection1, test-1)$"
- assert_file_has_content dest-refs "^(org.example.Collection1, test-2)$"
- assert_not_file_has_content dest-refs "^(org.example.Collection1, test-3)$"
+ assert_file_has_content dest-refs "^(org\.example\.Collection1, test-1)$"
+ assert_file_has_content dest-refs "^(org\.example\.Collection1, test-2)$"
+ assert_not_file_has_content dest-refs "^(org\.example\.Collection1, test-3)$"
assert_has_file "${usb_mount}"/.ostree/repo/summary
# Pull into a second local repository (theoretically, a separate computer).
${CMD_PREFIX} ostree --repo=peer-repo_$fs_type remote add remote1 file://just-here-for-the-keyring --collection-id org.example.Collection1 --gpg-import="${test_tmpdir}/gpghome/key1.asc"
${CMD_PREFIX} ostree --repo=peer-repo_$fs_type find-remotes --finders=mount org.example.Collection1 test-1 > find-results
- assert_not_file_has_content find-results "^No results.$"
+ assert_not_file_has_content find-results "^No results\.$"
assert_file_has_content find-results "^Result 0: file://${usb_mount}"
- assert_file_has_content find-results "(org.example.Collection1, test-1) = $(cat ref1-checksum)$"
+ assert_file_has_content find-results "(org\.example\.Collection1, test-1) = $(cat ref1-checksum)$"
${CMD_PREFIX} ostree --repo=peer-repo_$fs_type find-remotes --finders=mount --pull org.example.Collection1 test-1 > pull-results
- assert_file_has_content pull-results "^Pulled 1/1 refs successfully.$"
+ assert_file_has_content pull-results "^Pulled 1/1 refs successfully\.$"
${CMD_PREFIX} ostree --repo=peer-repo_$fs_type refs --collections > refs
- assert_file_has_content refs "^(org.example.Collection1, test-1)$"
+ assert_file_has_content refs "^(org\.example\.Collection1, test-1)$"
${SUDO} umount "${MOUNT_INTEGRATION_DEV}"
${CMD_PREFIX} ostree --repo=repo summary --update
${CMD_PREFIX} ostree --repo=repo summary --view > summary
-assert_file_has_content summary "(org.example.Collection, test-1)$"
-assert_file_has_content summary "(org.example.Collection, test-2)$"
-assert_file_has_content summary "(org.example.Collection, test-3)$"
-assert_file_has_content summary "(org.example.Collection, test-4)$"
-assert_file_has_content summary "(org.example.Collection, test-5)$"
-assert_file_has_content summary "^Collection ID (ostree\.summary\.collection-id): org.example.Collection$"
+assert_file_has_content summary "(org\.example\.Collection, test-1)$"
+assert_file_has_content summary "(org\.example\.Collection, test-2)$"
+assert_file_has_content summary "(org\.example\.Collection, test-3)$"
+assert_file_has_content summary "(org\.example\.Collection, test-4)$"
+assert_file_has_content summary "(org\.example\.Collection, test-5)$"
+assert_file_has_content summary "^Collection ID (ostree\.summary\.collection-id): org\.example\.Collection$"
# Test that mirrored branches are listed too.
${CMD_PREFIX} ostree --repo=repo refs --collections --create=org.example.OtherCollection:test-1-mirror test-1
${CMD_PREFIX} ostree --repo=repo summary --update
${CMD_PREFIX} ostree --repo=repo summary --view > summary
-assert_file_has_content summary "(org.example.OtherCollection, test-1-mirror)$"
+assert_file_has_content summary "(org\.example\.OtherCollection, test-1-mirror)$"
# Test that remote refs are listed, but only if they have collection IDs
cd ${test_tmpdir}
${CMD_PREFIX} ostree --repo=repo summary --update
${CMD_PREFIX} ostree --repo=repo summary --view > summary
-assert_file_has_content summary "(org.example.RemoteCollection, rcommit)$"
+assert_file_has_content summary "(org\.example\.RemoteCollection, rcommit)$"
cd ${test_tmpdir}
mkdir no-collection-repo
# Check the ostree-metadata ref has also been created with the same content and appropriate bindings.
${CMD_PREFIX} ostree --repo=repo refs --collections > refs
-assert_file_has_content refs "^(org.example.Collection1, ostree-metadata)$"
+assert_file_has_content refs "^(org\.example\.Collection1, ostree-metadata)$"
${CMD_PREFIX} ostree --repo=repo show ostree-metadata --raw > metadata
assert_file_has_content metadata "'map': <@a{sv} {}>"
-assert_file_has_content metadata "'ostree.ref-binding': <\['ostree-metadata'\]>"
-assert_file_has_content metadata "'ostree.collection-binding': <'org.example.Collection1'>"
+assert_file_has_content metadata "'ostree\.ref-binding': <\['ostree-metadata'\]>"
+assert_file_has_content metadata "'ostree\.collection-binding': <'org\.example\.Collection1'>"
# There should be 5 commits in the ostree-metadata branch, since we’ve updated the summary 5 times.
${CMD_PREFIX} ostree --repo=repo log ostree-metadata | grep 'commit ' | wc -l > commit-count
${CMD_PREFIX} ostree --repo=repo checkout test2 test2-checkout2
getfattr -m . test2-checkout2/firstfile > attrs
-assert_file_has_content attrs '^user.ostree-test'
-assert_file_has_content attrs '^user.test0'
+assert_file_has_content attrs '^user\.ostree-test'
+assert_file_has_content attrs '^user\.test0'
getfattr -n user.ostree-test --only-values test2-checkout2/firstfile > v0
assert_file_has_content v0 '^testvalue$'
getfattr -n user.test0 --only-values test2-checkout2/firstfile > v1